﻿@model IEnumerable<SecsaMvcApplication.Models.AtendenteAmbulatorio>

@{
    ViewBag.Title = "Lista";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using PagedList.Mvc;
@using PagedList;

<section>
    <div class="page-header">
        <h1>Atendentes do Ambulatório</h1>
    </div>
    <div class="row-fluid m-fluid">
        <div class="span12 m-widget">
            <div class="m-widget-header">
                <h3>Lista</h3>
            </div>
            <div class="m-widget-body">
				<p>
					@Html.ActionLink("Novo cadastro", "Create")
				</p>
				<hr class="hr-invisible" />
				@if (Model.Count() < 1) {
					<p>
						Nenhum registro foi feito ainda.
					</p>
				} else {
					<table class="table table-striped table-condensed">
						<thead>
							<tr>
								<th>
									@Html.DisplayNameFor(model => model.Anotacao)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.DataCadastro)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.DataUltimaAtualizacao)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.Nome)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.Cpf)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.Email)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.NomeUsuario)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.Senha)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.DataUltimoLogin)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.FalhasLogin)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.DataUltimaFalhaLogin)
								</th>
								<th>
									@Html.DisplayNameFor(model => model.Bloqueado)
								</th>
							<th></th>
							</tr>
						</thead>
						<tbody>
							@foreach (var item in Model) {
								<tr>
										<td>
											@Html.DisplayFor(modelItem => item.Anotacao)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.DataCadastro)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.DataUltimaAtualizacao)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.Nome)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.Cpf)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.Email)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.NomeUsuario)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.Senha)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.DataUltimoLogin)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.FalhasLogin)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.DataUltimaFalhaLogin)
										</td>
										<td>
											@Html.DisplayFor(modelItem => item.Bloqueado)
										</td>
									<td>
										@Html.ActionLink("Abrir", "Details", new { id=item.Id }, new { @class = "btn btn-primary" })
										@Html.ActionLink("Editar", "Edit", new { id=item.Id }, new { @class = "btn btn-info" })
										@Html.ActionLink("Apagar", "Delete", new { id=item.Id }, new { @class = "btn btn-danger" })
									</td>
								</tr>
							}
						</tbody>
					</table>
				}
				@Html.PagedListPager( (IPagedList)Model, page => Url.Action("Index", new { page }) )
			</div>
		</div>
	</div>
</section>
